<?php
/**
 * Created by PhpStorm.
 * User: XD
 * Date: 2017/9/8
 * Time: 11:56
 */
namespace app\log; 
function autoLoadClass($className)
{
    $count=strpos($className,"app\log");
    $str=substr_replace($className,"",$count,7);
    //上面两句去除命名空间
    $file = dirname(__FILE__).$str.".php";
    //echo "file:".$file;
    if(file_exists($file)){
        //echo "判断进入，应该跳出循环了";
        require_once ($file);
    }
}

spl_autoload_register('\app\log\autoLoadClass');
UseLog::go();
//如果要使用log  请先调用该文件以include的方式

